<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="css/common.css" rel="stylesheet" type="text/css" />
<link href="css/product.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript"
	src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
	<!-- 引入Vue -->
<script src="js/vue.min.js"></script>
<!-- 引入axios -->
<script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/axios/0.21.0/axios.min.js"></script>
<title>大麦商城</title>
<script type="text/javascript" src = "js/damai.js">
// jQuery 加载函数
/* $(function(){
	let pid = location.search.replace(/\?pid=(\d+)/, "$1");
	$.get("detail.s?pid="+pid, null, function(json){
		let p = JSON.parse(json);
		$(".span18 .productImage img").attr("src",p.image);
		$(".span18 .name").text(p.pname);
		$(".span18 .sn>div").text(p.pid);
		$("#shopPrice").text(p.shopPrice);
		$("#marketPrice").text(p.marketPrice);
		$("#pdesc").text(p.pdesc);
		$(".pImage").attr("src",p.image);
	});
}); */
</script>
<script type="text/javascript" src = "js/top.js"></script>
</head>
<body>

	<div class="container header">

		<div class="span5">
			<div class="logo">
				<a href="index.html"> <img
					src="image/r___________renleipic_01/logo.png" alt="依依不舍" />
				</a>
			</div>
		</div>
		<div class="span9">
			<div class="headerAd">
				<img src="image/header.jpg" width="320" height="50" alt="正品保障"
					title="正品保障" />
			</div>
		</div>
		<div class="span10 last">
			<top></top>
			<div class="cart">
				<a href="cart.html">购物车</a>
			</div>
			<div class="phone">
				客服热线: <strong>13234390126</strong>
			</div>
		</div>



		<category></category>


	</div>
	<script type="text/javascript">
	new Vue({
		el : ".header"
	})
	
	</script>
	<div class="container productContent">



		<div class="span6">
			<div class="hotProductCategory">
			<bigflgory></bigflgory>
				
			</div>
		</div>

		<div class="span18 last">

			<div class="productImage">
				<a title="" style="outline-style: none; text-decoration: none;"
					id="zoom"
					href="http://image/r___________renleipic_01/bigPic1ea8f1c9-8b8e-4262-8ca9-690912434692.jpg"
					rel="gallery">
					<div class="zoomPad">
						<img style="opacity: 1;" title="" class="medium"
							:src="product.image">
						<div
							style="display: block; top: 0px; left: 162px; width: 0px; height: 0px; position: absolute; border-width: 1px;"
							class="zoomPup"></div>
						<div
							style="position: absolute; z-index: 5001; left: 312px; top: 0px; display: block;"
							class="zoomWindow">
							<div style="width: 368px;" class="zoomWrapper">
								<div style="width: 100%; position: absolute; display: none;"
									class="zoomWrapperTitle"></div>
								<div style="width: 0%; height: 0px;" class="zoomWrapperImage">
									<img
										src="%E5%B0%9A%E9%83%BD%E6%AF%94%E6%8B%89%E5%A5%B3%E8%A3%852013%E5%A4%8F%E8%A3%85%E6%96%B0%E6%AC%BE%E8%95%BE%E4%B8%9D%E8%BF%9E%E8%A1%A3%E8%A3%99%20%E9%9F%A9%E7%89%88%E4%BF%AE%E8%BA%AB%E9%9B%AA%E7%BA%BA%E6%89%93%E5%BA%95%E8%A3%99%E5%AD%90%20%E6%98%A5%E6%AC%BE%20-%20Powered%20By%20Mango%20Team_files/6d53c211-2325-41ed-8696-d8fbceb1c199-large.jpg"
										style="position: absolute; border: 0px none; display: block; left: -432px; top: 0px;">
								</div>
							</div>
						</div>
						<div
							style="visibility: hidden; top: 129.5px; left: 106px; position: absolute;"
							class="zoomPreload">Loading zoom</div>
					</div>
				</a>

			</div>
			<div class="name">{{product.pname}}</div>
			<div class="sn">
				<div>编号：1</div>
			</div>
			<div class="info">
				<dl>
					<dt>商城价:</dt>
					<dd>
						<strong id="shopPrice">{{product.shopPrice}}元/份</strong> 参 考 价：
						<del id="marketPrice">{{product.marketPrice}}元/份</del>
					</dd>
				</dl>
				<dl>
					<dt>促销:</dt>
					<dd>
						<a target="_blank" title="限时抢购 (2014-07-30 ~ 2015-01-01)">限时抢购</a>
					</dd>
				</dl>
				<dl>
					<dt></dt>
					<dd>
						<span> </span>
					</dd>
				</dl>
			</div>
			<div class="action">
				<form action="cart.html" method="post">
					<input type="hidden" name="pid" value="1" />
					<dl class="quantity">
						<dt>购买数量:</dt>
						<dd>
							<input  v-model="count" id="quantity" name="count" value="1" maxlength="4"
								onpaste="return false;" type="text">
							<div>
								<span @click="count++" id="increase" class="increase">&nbsp;</span> <span
									@click="count--" id="decrease" class="decrease">&nbsp;</span>
							</div>
						</dd>
						<dd>件</dd>
					</dl>
					<div class="buy">
						<input @click.prevent="addCart()" id="addCart" class="addCart" value="加入购物车" type="submit">
					</div>
				</form>
			</div>
			<div id="bar" class="bar">
				<ul>
					<li id="introductionTab"><a href="#introduction">商品介绍</a></li>

				</ul>
			</div>

			<div id="introduction" name="introduction" class="introduction">
				<div class="title">
					<strong>商品介绍</strong>
				</div>
				<div>
					{{product.pdesc}}
					<br /> <br /> <img class="pImage" :src="product.image"
						align="middle" />
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		var v = new Vue({
			el : ".productContent",
			data : {
				product :{},
				count : 1
			},
			created(){
				let pid = location.search.replace(/\?pid=(\d+)/, "$1");
				axios.get("detail.s?pid="+pid).then(res=>{
					this.product = res.data;
				})
			},
			methods:{
				addCart(){
					let pid = location.search.replace(/\?pid=(\d+)/, "$1");
					let url = "addCart.s?pid="+pid+"&count="+this.count;
					axios.get(url).then(res=>{
						if(res.data.code==1){
							location.href="cart.html";
						}else{
							alert(res.data.msg);
							location.href="login.html";
						}
					})
				}
			}
		});
	
	</script>
	<div class="container footer">
		<div class="span24">
			<div class="footerAd">
				<img src="image\r___________renleipic_01/footer.jpg" alt="我们的优势"
					title="我们的优势" height="52" width="950">
			</div>
		</div>
		<div class="span24">
			<ul class="bottomNav">
				<li><a href="#">关于我们</a> |</li>
				<li><a href="#">联系我们</a> |</li>
				<li><a href="#">诚聘英才</a> |</li>
				<li><a href="#">法律声明</a> |</li>
				<li><a>友情链接</a> |</li>
				<li><a target="_blank">支付方式</a> |</li>
				<li><a target="_blank">配送方式</a> |</li>
				<li><a>SHOP++官网</a> |</li>
				<li><a>SHOP++论坛</a></li>
			</ul>
		</div>
		<div class="span24">
			<div class="copyright">Copyright © 2005-2013 Mango商城 版权所有</div>
		</div>
	</div>




</body>
</html>